<template>
  <div class="home-wrap">
    <!-- 主页面 -->
    <home-header></home-header>
    <home-swiper :swiperlist='swiperList'></home-swiper>
    <home-icons :iconslist='iconsList'></home-icons>
    <home-recommend :recommendlist='recommendList'></home-recommend>
    <home-weekend :weekendlist='weekendList'></home-weekend>
  </div>
</template>

<script>
  import HomeHeader from './components/Header'
  import HomeSwiper from './components/Swiper'
  import HomeIcons from './components/Icons'
  import HomeRecommend from './components/Recommend'
  import HomeWeekend from './components/Weekend'
  import axios from 'axios';
  export default {
    name:'Home',
    data(){
      return {
        swiperList:[],
        iconsList:[],
        recommendList:[],
        weekendList:[]
      }
    },
    components:{
      HomeHeader,
      HomeSwiper,
      HomeIcons,
      HomeRecommend,
      HomeWeekend
    },
    mounted:function(){
      axios.get('goWhereData/Home.json')
          .then((res)=>{
            let resData = res.data.data;
            this.swiperList = resData.swiperList;
            this.iconsList = resData.iconsList;
            this.recommendList = resData.recommendList;
            this.weekendList = resData.weekendList;
          });
    }
  }
</script>

<style scoped="scoped">
.home-wrap{
  background-color: rgb(245,245,245);

}
</style>
